import router from './router.js';
import {
    getAdmin
} from './../utils/auth.js';
router.beforeEach((to, from, next) => {
    // ... 跳转之前
    if (getAdmin()) { //如果有就直接到首页咯
        if (to.path == '/login' || to.path == '/Registered' || to.path == '/forget') { // 如果是登录注册页面路径，就直接next('/)
            next('/');
        } else {
            next();
        }
    } else {
        if (to.path == '/login' || to.path == '/Registered' || to.path == '/forget') { //如果是登录注册页面路径，就直接next()
            next();
        } else { //不然就跳转到登录；
            next('/login');
        }
    }

})
export default router;